/*
 *
 *  Copyright (C) 2007-2020 SimplyCore, LLC
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 *
 */

#ifdef _USBD_ENABLE_VHCI_
#include "usbd.h"
ssize_t IlllllIlI(void*,const char __user*,size_t);ssize_t IIIlIIIII(void*,char 
__user*,size_t);long IlIIllllI(void*,unsigned int,unsigned long);
#ifdef CONFIG_COMPAT
long llIlIIllI(void*,unsigned int,unsigned long);
#endif
int IlIllIlll(void*,int);int llIlllIlI(void*,int);void lIIIIIlIl(void*);void 
lllIlllII(void*);unsigned int llIIlIlIl(void*,struct file*,poll_table*lIIllI);
int llIIIIlll(void*,struct vm_area_struct*);static struct IIIllllI IlIIlIlIl[]={
{"\x74\x79\x70\x65","\x76\x73\x74\x75\x62",NULL},{NULL,NULL,NULL},};int 
llllIIlIl(struct lIlIIl*lIllI){struct IIIlll*lllll;lllll=IlllIIl(sizeof(*lllll),
GFP_KERNEL);if(lllll){mutex_init(&lllll->mutex);lllll->context=lIllI;lllll->
IIllll=-(0xf03+3585-0x1d03);lllll->ops.open=IlIllIlll;lllll->ops.release=
llIlllIlI;lllll->ops.unlocked_ioctl=IlIIllllI;
#ifdef CONFIG_COMPAT
lllll->ops.compat_ioctl=llIlIIllI;
#endif
lllll->ops.read=IIIlIIIII;lllll->ops.write=IlllllIlI;lllll->ops.poll=llIIlIlIl;
lllll->ops.mmap=llIIIIlll;lllll->ops.IlIIlIll=lIIIIIlIl;lllll->ops.llIIllll=
lllIlllII;lllll->IIllllIl=IlIIlIlIl;lIllI->lllll=lllll;return(0xe4c+1343-0x138b)
;}return-ENOMEM;}void IIlIllIlI(struct lIlIIl*lIllI){if(lIllI->lllll){IlIIIIII(
lIllI);lIlIll(lIllI->lllll);lIllI->lllll=NULL;}}int IllIIIIll(struct lIlIIl*
lIllI){return IllllIlI(lIllI->lllll,(0xc95+2984-0x183b),-(0xa69+1903-0x11d7));}
void IlIIIIII(struct lIlIIl*lIllI){lllIllII(lIllI->lllll);}ssize_t IIIlIIIII(
void*context,char __user*IllIl,size_t llIlI){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x72\x65\x61\x64\x3a" "\n"
);return(0x162d+2327-0x1f44);}ssize_t IlllllIlI(void*context,const char __user*
IllIl,size_t llIlI){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x77\x72\x69\x74\x65" "\n"
);return(0x1a2d+724-0x1d01);}int lIIlIIllI(struct lIlIIl*lIllI,void __user*IllIl
){unsigned long offset=(unsigned long)IllIl;int IlIlI;unsigned long flags;struct
 lllIIl*IIlII;void*llIIl;size_t IlIIIl;IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x2b\x2b" "\n"
);if(offset>=lIllI->lIIllIll){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x2d\x2d\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x61\x72\x67\x75\x6d\x65\x6e\x74" "\n"
);return-EINVAL;}if((lIllI->lIIllIll-offset)<sizeof(IlIllI)){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x2d\x2d\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x61\x72\x67\x75\x6d\x65\x6e\x74" "\n"
);return-EINVAL;}if(lIllI->IIlIIllI){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x2d\x2d\x20\x72\x65\x73\x65\x74\x20\x69\x6e\x20\x70\x72\x6f\x67\x72\x65\x73\x73" "\n"
);return-ENODATA;}llIIl=(char*)lIllI->IIlIIlIl+offset;IlIIIl=((IlIllI*)llIIl)->
IIIII;IIlII=NULL;
spin_lock_irqsave(&lIllI->IIllII,flags);if(!list_empty(&lIllI->lllIlll)){IIlII=
list_entry(lIllI->lllIlll.next,struct lllIIl,llllIl);list_del_init(&IIlII->
llllIl);}spin_unlock_irqrestore(&lIllI->IIllII,flags);IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x70\x76\x72\x65\x71\x20\x3d\x20\x30\x78\x25\x70" "\n"
,IIlII);if(IIlII){IlIlI=lIlIlIlII(lIllI,IIlII,llIIl,IlIIIl);if(IlIlI>=
(0xf04+3067-0x1aff)){spin_lock_irqsave(&lIllI->IIllII,flags);if(lIIIIIIl(IIlII))
{
spin_unlock_irqrestore(&lIllI->IIllII,flags);IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x72\x65\x71\x75\x65\x73\x74\x20\x68\x61\x73\x20\x62\x65\x65\x6e\x20\x63\x61\x6e\x63\x65\x6c\x6c\x65\x64\x21" "\n"
);IIllIlII(IIlII,-ECONNRESET);lIIlllII(IIlII);IlIlI=-ENODATA;}else{
list_add_tail(&IIlII->llllIl,&lIllI->Illlllll);spin_unlock_irqrestore(&lIllI->
IIllII,flags);llllIII((lIIll)llIIl);}}else if(IlIlI==-EMSGSIZE){
if(lIIIIIIl(IIlII)){
spin_unlock_irqrestore(&lIllI->IIllII,flags);IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x72\x65\x71\x75\x65\x73\x74\x20\x68\x61\x73\x20\x62\x65\x65\x6e\x20\x63\x61\x6e\x63\x65\x6c\x6c\x65\x64\x21" "\n"
);IIllIlII(IIlII,-ECONNRESET);lIIlllII(IIlII);IlIlI=-ENODATA;}else{IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x6e\x6f\x74\x20\x65\x6e\x6f\x75\x67\x68\x20\x62\x75\x66\x66\x65\x72\x20\x74\x6f\x20\x70\x61\x63\x6b\x20\x74\x68\x65\x20\x72\x65\x71\x75\x65\x73\x74" "\n"
);
list_add(&IIlII->llllIl,&lIllI->lllIlll);spin_unlock_irqrestore(&lIllI->IIllII,
flags);
wake_up(&lIllI->lIIllI);}}else{IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x63\x61\x6e\x20\x6e\x6f\x74\x20\x70\x61\x63\x6b\x20\x72\x65\x71\x75\x65\x73\x74\x2c\x20\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
,IlIlI);IIllIlII(IIlII,IlIlI);lIIlllII(IIlII);IlIlI=-ENODATA;}}else{IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x6e\x6f\x20\x65\x6e\x74\x72\x79" "\n"
);IlIlI=-ENODATA;}IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x2d\x2d\x20\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
,IlIlI);return IlIlI;}int lIlllllIII(struct lIlIIl*lIllI,void __user*IllIl){
unsigned long offset=(unsigned long)IllIl;int IlIlI;lIIll IIlIl;unsigned long 
flags;struct lllIIl*IIlII;struct lllIIl*lIlIIII;IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x77\x72\x69\x74\x65\x5f\x75\x6e\x72\x62\x3a\x20\x2b\x2b" "\n"
);if(offset>=lIllI->IIlIIIIl){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x2d\x2d\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x61\x72\x67\x75\x6d\x65\x6e\x74" "\n"
);return-EINVAL;}if((lIllI->IIlIIIIl-offset)<sizeof(IlIllI)){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x2d\x2d\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x61\x72\x67\x75\x6d\x65\x6e\x74" "\n"
);return-EINVAL;}IIlIl=(lIIll)((char*)lIllI->lllIllll+offset);if((lIllI->
IIlIIIIl-offset)<IIlIl->IlIII.IIIII){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x72\x65\x61\x64\x5f\x75\x6e\x72\x62\x3a\x20\x2d\x2d\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61" "\n"
);return-EINVAL;}llllIII(IIlIl);IIlII=NULL;spin_lock_irqsave(&lIllI->IIllII,
flags);list_for_each_entry(lIlIIII,&lIllI->Illlllll,llllIl){if(lIlIIII->IIllI==
IIlIl->IlIII.IlIIll){
list_del_init(&lIlIIII->llllIl);
IIlII=lIlIIII;break;}}spin_unlock_irqrestore(&lIllI->IIllII,flags);if(IIlII){int
 status;IlIlI=IlIlIllll(lIllI,IIlII,IIlIl,&status);if(IlIlI<(0x3e7+2551-0xdde)){
spin_lock_irqsave(&lIllI->IIllII,flags);if(lIIIIIIl(IIlII)){
spin_unlock_irqrestore(&lIllI->IIllII,flags);IIllIlII(IIlII,-ECONNRESET);
lIIlllII(IIlII);}else{



list_add_tail(&IIlII->llllIl,&lIllI->Illlllll);spin_unlock_irqrestore(&lIllI->
IIllII,flags);}}else{IIllIlII(IIlII,status);lIIlllII(IIlII);}}else{IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x77\x72\x69\x74\x65\x5f\x75\x6e\x72\x62\x3a\x20\x72\x65\x71\x75\x65\x73\x74\x20\x6e\x6f\x74\x20\x66\x6f\x75\x6e\x64" "\n"
);IlIlI=(0x390+309-0x4c5);}IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x69\x6f\x63\x74\x6c\x5f\x77\x72\x69\x74\x65\x5f\x75\x6e\x72\x62\x3a\x20\x2d\x2d\x20\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
,IlIlI);return IlIlI;}int IIIIIIIIl(struct lIlIIl*lIllI,struct lIllIIIlI __user*
ioctl){lllII IlIll;lllII devnum;lllII busnum;if(get_user(IlIll,&ioctl->lIIlII.
IIlllIl)<(0x7fa+4943-0x1b49)){return-EFAULT;}if(IlIll!=sizeof(struct lIllIIIlI))
{return-EINVAL;}lllIllIII(lIllI,&busnum,&devnum);if(put_user(busnum,&ioctl->
busnum)<(0x18f9+585-0x1b42)){return-EFAULT;}if(put_user(devnum,&ioctl->devnum)<
(0x5b2+1927-0xd39)){return-EFAULT;}return(0x5fd+3154-0x124f);}long IIIIIllII(
void*context,unsigned int lIIIIl,void __user*IlIIII){struct lIlIIl*lIllI=context
;int IlIlI=(0x1390+4921-0x26c9);IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x69\x6f\x63\x74\x6c\x3a\x20\x2b\x2b\x20\x63\x6d\x64\x3d\x25\x64\x20\x61\x72\x67\x3d\x30\x78\x25\x70" "\n"
,lIIIIl,IlIIII);switch(lIIIIl){case IlIlIllII:IlIlI=lIIlIIllI(lIllI,IlIIII);
break;case IllIllIIl:IlIlI=lIlllllIII(lIllI,IlIIII);break;case IllIIIIII:IlIlI=
IIIIIIIIl(lIllI,IlIIII);break;default:IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x69\x6f\x63\x74\x6c\x3a\x20\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x69\x6f\x63\x74\x6c" "\n"
);IlIlI=-EINVAL;break;}IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x69\x6f\x63\x74\x6c\x3a\x20\x2d\x2d\x20\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
,IlIlI);return IlIlI;}long IlIIllllI(void*context,unsigned int lIIIIl,unsigned 
long IlIIII){return IIIIIllII(context,lIIIIl,(void __user*)IlIIII);}
#ifdef CONFIG_COMPAT
long llIlIIllI(void*context,unsigned int lIIIIl,unsigned long IlIIII){return 
IIIIIllII(context,lIIIIl,compat_ptr(IlIIII));}
#endif
int llIIIIlll(void*context,struct vm_area_struct*IlllIll){int IlIlI;struct 
lIlIIl*lIllI=context;void*IllIl;unsigned long IIlIIl;unsigned long offset;IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x6d\x6d\x61\x70\x3a\x20\x2b\x2b" "\n"
);IIlIIl=IlllIll->vm_end-IlllIll->vm_start;offset=IlllIll->vm_pgoff<<PAGE_SHIFT;
if(IIlIIl<sizeof(IlIllI)||IIlIIl>lIlIlIII){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x6d\x6d\x61\x70\x3a\x20\x2d\x2d\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x6c\x65\x6e\x67\x74\x68" "\n"
);return-EINVAL;}if(offset!=(0x1aa4+1425-0x2035)&&offset!=0x80000000U){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x6d\x6d\x61\x70\x3a\x20\x2d\x2d\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x6f\x66\x66\x73\x65\x74" "\n"
);return-EINVAL;}IllIl=vmalloc(IIlIIl);if(IllIl==NULL){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x6d\x6d\x61\x70\x3a\x20\x6e\x6f\x20\x6d\x65\x6d\x6f\x72\x79\x20\x66\x6f\x72\x20\x77\x72\x69\x74\x65\x62\x75\x66" "\n"
);return-ENOMEM;}
IlIlI=IlllIIllI(IllIl,IlllIll);if(IlIlI==(0x5cd+1324-0xaf9)){if(offset==
(0x1d62+2420-0x26d6)){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x6d\x6d\x61\x70\x3a\x20\x6d\x61\x70\x20\x72\x65\x61\x64\x62\x75\x66" "\n"
);if(lIllI->IIlIIlIl){vfree(lIllI->IIlIIlIl);}lIllI->IIlIIlIl=IllIl;lIllI->
lIIllIll=IIlIIl;}else{IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x6d\x6d\x61\x70\x3a\x20\x6d\x61\x70\x20\x77\x72\x69\x74\x65\x62\x75\x66" "\n"
);if(lIllI->lllIllll){vfree(lIllI->lllIllll);}lIllI->lllIllll=IllIl;lIllI->
IIlIIIIl=IIlIIl;}}IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x6d\x6d\x61\x70\x3a\x20\x2d\x2d\x20\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
,IlIlI);return IlIlI;}

int IlIllIlll(void*context,int IIlllII){int IlIlI=(0x1733+1979-0x1eee);struct 
lIlIIl*lIllI=context;IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x6f\x70\x65\x6e\x3a\x20\x2b\x2b\x20\x25\x64" "\n"
,IIlllII);if(IIlllII==(0xc81+6783-0x26ff)){
lIllI=lIllI;
}IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x6f\x70\x65\x6e\x3a\x20\x2d\x2d\x20\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
,IlIlI);return IlIlI;}

int llIlllIlI(void*context,int IIlllII){struct lIlIIl*lIllI=context;IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x72\x65\x6c\x65\x61\x73\x65\x20\x25\x64" "\n"
,IIlllII);if(IIlllII==(0x1728+1967-0x1ed7)){if(lIllI->IIlIIlIl){vfree(lIllI->
IIlIIlIl);lIllI->IIlIIlIl=NULL;}if(lIllI->lllIllll){vfree(lIllI->lllIllll);lIllI
->lllIllll=NULL;}

}return(0x73b+1185-0xbdc);}void lIIIIIlIl(void*context){struct lIlIIl*lIllI=
context;IlllllII(lIllI);}void lllIlllII(void*context){struct lIlIIl*lIllI=
context;IlIllIIl(lIllI);}unsigned int llIIlIlIl(void*context,struct file*lIlllI,
poll_table*lIIllI){int IIIllIII;unsigned long flags;struct lIlIIl*lIllI=context;
poll_wait(lIlllI,&lIllI->lIIllI,lIIllI);spin_lock_irqsave(&lIllI->IIllII,flags);
IIIllIII=list_empty(&lIllI->lllIlll);spin_unlock_irqrestore(&lIllI->IIllII,flags
);if(!IIIllIII&&!lIllI->IIlIIllI){IlllI(
"\x75\x73\x62\x64\x5f\x76\x73\x74\x75\x62\x5f\x6d\x69\x6e\x6f\x72\x5f\x70\x6f\x6c\x6c\x3a\x20\x71\x75\x65\x75\x65\x20\x6e\x6f\x74\x20\x65\x6d\x70\x74\x79" "\n"
);return((POLLOUT|POLLWRNORM)|(POLLIN|POLLRDNORM));}return(POLLOUT|POLLWRNORM);}
#endif 

